import { createStore } from 'vuex'
const commonStore = createStore({
	//存放状态
	state: {
		"reload": [],
	},
	mutations: {
		addReload(state, pageName : string) {
			const idx = state.reload.indexOf(pageName)
			if (idx < 0) state.reload.push(pageName)
		},
		delReload(state, pageName : string) {
			const idx = state.reload.indexOf(pageName)
			if (idx >= 0) state.reload.splice(idx, 1)
		},
		reloadAll(state) {
			state.reload = ['index', 'userIndex']
		},
	},

})

export default commonStore